﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EasyBuy.BLL;
using EasyBuy.DAL;
using EasyBuy.Model;

namespace EasyBuy.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            String Uname = "tian";
            String UPassword = "yuliang";

            #region 测试DAL层方法
            //UserService userService = new UserService();
            //User user = userService.GetUserByNameOrPass(Uname.Trim(), UPassword.Trim());
            //if (user != null)
            //{
            //    Console.WriteLine("用户名:{0}  密码:{1}  状态码:{2}", user.UName, user.UPassword, user.UStatus);
            //}
            //else
            //{
            //    Console.WriteLine("登录失败。。。。。");
            //}
            #endregion

            #region 测试BLL层方法
            UserManager userManager = new UserManager();
            User user = userManager.Login(Uname.Trim(), UPassword.Trim());
            if (user != null)
            {
                Console.WriteLine("用户名:{0}  密码:{1}  状态码:{2}", user.UName, user.UPassword, user.UStatus);
            } 
            else
            {
                Console.WriteLine("登录失败。。。。。");
            }
            #endregion
           
            Console.ReadKey();
        }
    }
}
